*** Run this command to get stars on lincom estimation commands ***
program define sigstar_lincom, rclass
syntax [anything], [p(real 0)] [se(real 0)] [b(real 0)] [n(real 1000000)] [prec(real 0)] [bstar] [sestar] [pstar] [nopar] [pbrackets]



	if "`anything'" != "" {
	cap lincom `anything'
	if _rc==0 {
	
		loc b = `r(estimate)'
		loc se = `r(se)'
		loc p = `r(p)'
	}
	}
quietly {
	if "`p'" == "." | "`p'" == "" {

		return loc bstar = " "
		return loc sestar = " "
		return loc pstar = " "

	}

	else {

		if `p' < 0.0101 loc star = "\sym{***}"
		else if `p' < 0.0501 loc star = "\sym{**}"
		else if `p' < 0.1001 loc star = "\sym{*}"

		if "`prec'" == "" loc prec = 3

		return loc bstar = string(`b', "%9.`prec'f") + "`star'"
		return loc sestar = "(" + string(`se', "%9.`prec'f") + ")"

		loc pstar = string(`p', "%9.`prec'f")
		if "`pstar'" != "" loc pstar = "`pstar'" + "`star'"
		if "`pbrackets'" != "" loc pstar = "[" + "`pstar'" + "]"
		return loc pstar = "`pstar'"

	}

}

end
